package com.hiwhitley.easy.day16;

import java.util.HashSet;

/**
 * Created by hiwhitley on 2016/9/10.
 */
public class ContainDuplicate {
    public boolean containsDuplicate(int[] nums) {
        HashSet<Integer> hashSet = new HashSet<>();
        for (int i = 0; i < nums.length; i++) {
            if (!hashSet.add(nums[i]))
                return true;
        }
        return false;
    }
}
